package com.zealfi.wk.configCenter;

import org.eclipse.jgit.api.TransportConfigCallback;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.cloud.config.server.config.TransportConfiguration;
import org.springframework.cloud.config.server.ssh.SshUriProperties;
import org.springframework.context.annotation.Bean;

/**
 * Created by kuan at 2018-05-07 下午 3:27
 */
@EnableConfigServer
@SpringCloudApplication
public class ConfigCenterApplication {

    @Bean
    public TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties) {
        return new TransportConfiguration.FileBasedSshTransportConfigCallback(sshUriProperties);
    }

    public static void main(String[] args) {
        new SpringApplicationBuilder(ConfigCenterApplication.class).web(true).run(args);
    }
}
